package com.zeng.conditional;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

/**
 * @author Zqm
 * @Title: MyImportSelector
 * @ProjectName SpringAnnotationDriven
 * @date 2019/1/14
 * 自定义逻辑 返回需要导入的组件
 */
public class MyImportSelector implements ImportSelector {


    /**
     * 返回导入到容器中的 全类名
     * @param annotationMetadata  当前标注@Import 注解类的所有注解信息
     * @return
     */
    @Override
    public String[] selectImports(AnnotationMetadata annotationMetadata) {

        return new String[]{"com.zeng.bean.Blue","com.zeng.bean.Yellow"};
    }
}
